package
{
	import asf.events.ServiceResponderEvent;
	import asf.remoting.Gateway;
	import asf.remoting.GatewaySingle;
	import asf.remoting.ServiceResponder;
	
	import flash.display.Sprite;

	public class GatewayTest extends Sprite
	{
		public function GatewayTest( )
		{
			super( );
			
			var gateway:Gateway = GatewaySingle.getInstance( );
			
			gateway.gatewayURL = "http://yourdomain.com/your_gateway/";
			gateway.namespacePath = "package.to.ServerObject";
			
			
			//var res:ServiceResponder = gateway.yourServerSideMethod( /* ... rest parameters if needed */ );
			
			/*
			res.addEventListener( ServiceResponderEvent.RESULT, onResult );
			res.addEventListener( ServiceResponderEvent.STATUS, onFault );
			*/
		}
		
		private function onResult( evt:ServiceResponderEvent ):void
		{
			var res:ServiceResponder = evt.target as ServiceResponder;
			
			dtrace( res.resultData );
		}
		
		private function onFault( evt:ServiceResponderEvent ):void
		{
			var res:ServiceResponder = evt.target as ServiceResponder;
			
			dtrace( res.faultData );
		}
	}
}
